package StudyCode.summary.zipfile;

import java.io.IOException;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class GetZipEntry {
	public static void main(String args[]) {
		try {
			ZipFile zipFile = new ZipFile("E:/Copy/zipdemo.zip");

			Enumeration e = zipFile.entries();

			while (e.hasMoreElements()) {
				ZipEntry entry = (ZipEntry) e.nextElement();

				String comment = entry.getComment();

				if ("".equals(comment))
					System.out.println(comment + " 未找到 entry " + entry.getName());
				else
					System.out.println("ZIPEntry " + entry.getName());
			}
			zipFile.close();

		} catch (IOException ioe) {
			ioe.printStackTrace();
		}
	}
}
